<?php  
class Home_Controller
{  
    public function index()  
    {
    	$home = new Home_Model;
    	
        Global $db;

        $where['a.uid'] = array('in',array('1','2','3'));
        $where['a.real_name'] = array('like','123');
        $where['a.username'] = array('like','123');
        $where['_logic'] = 'OR';

        $result = $db->where($where)
                     ->join('ask_usergroup as b ON a.groupid=b.groupid','left')
                     ->field('a.uid,a.real_name,a.username,b.grouptitle')
                     ->order("a.uid desc, a.username asc")
                     ->limit(0,6)
                     ->select('ask_user as a');
        
        //print_r($result);

        unset($where);

        // $where['uid'] = 1;
        // $data['real_name'] = '管理员';

        // $status = $db->where($where)->update('ask_user',$data);
        
        //$where['uid'] = 1;
        //$status = $db->where($where)->delete('ask_user');
        
        // $data['uid'] = 1;
        // $data['real_name'] = '管理员';
        // $data['username'] = 'admin';
        // $data['password'] = '28a8190e44e2f3cc295e7ab5f1ce9249';
        // $data['email'] = 'zhangshifeng1214@163.com';
        // $data['groupid'] = 8;
        // $data['credits'] = 0;
        // $data['credit1'] = 0;
        // $data['credit2'] = 0;
        // $data['credit3'] = 0;
        // $data['regip'] = '127.0.0.1';
        // $data['regtime'] = '1338186079';
        // $data['lastlogin'] = '1338186079';
        // $data['gender'] = 1;
        // $data['bday'] = '1980-01-01';

        //$status = $db->insert('ask_user',$data);
        $where['uid'] = 1;
        $result = $db->where($where)->find('ask_user');
        
    	//echo $home->time().'<br>';
        $page = I("get.page/i");
        echo $page;
        
		$data['title'] = time();
		$data['list'] = array('0'=>'title_1','1'=>'title_2','2'=>'title_3');
        
    	display('index.php',$data);
    }
} 